import { isZiGuanEvir, getUserInfo, exportFile } from '../../utils/commonFunc';
import { PrimaryC } from '../../comps';

class CommonFuncDemo extends React.Component {
  componentDidMount() {
    let test = isZiGuanEvir();
    console.log('isZiGuanEvir', test);
    // 当前登录用户如果是超级管理员,返回：{isSuper:true}
    // 如果是租户管理员，返回：{ isSuper:false, isTenantAdmin:true,tenantName:xxxx}
    // 如果是普通用户，返回：{ isSuper:false, isTenantAdmin:false,tenantName:xxxx}
    let testGetUserInfo = getUserInfo();
    console.log('getUserInfo', testGetUserInfo);
  }
  exportFile = () => {
    exportFile('api/v1/assetssplit/excelimport/download', {});
  };
  render() {
    return <PrimaryC title={'导出'} onClick={this.exportFile}></PrimaryC>;
  }
}

export default CommonFuncDemo;
